<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/* JoomLeague League Management and Prediction Game for Joomla!
 * @version $Id: show_results_ranking.tpl.php 1151 2008-06-24 15:07:32Z julienv $
 * @package Joomleague
 * @copyright Copyright (C) 2007  JoomLeague
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see _joomleague_license.txt
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
*/ 

global $htmlHelper;

?>
<div id="joomleague">
<a name="jl_top" id="jl_top"></a>
<!-- Header with Project Name-->
<?php 
  if (    $results_config['show_project_heading'] == "1" 
       OR $overall_config['show_project_heading'] == "1" 
       OR $table_config['show_project_heading'] == "1" )   { 
    echo '<div class="componentheading"'; 
    if (    $results_config['show_print_button'] == "1" 
        OR  $overall_config['show_print_button'] == "1" 
        OR $table_config['show_print_button'] == "1" ) 
      echo ' style="float:left;"';
    echo ">"; 
    echo $htmlHelper->showTitle($joomleague, $overall_config['project_heading_type']); 
    echo "</div>";
    //<!-- Druckfunktion -->
    if (   $results_config['show_print_button'] == "1" 
        OR $overall_config['show_print_button'] == "1" 
        OR $table_config['show_print_button'] == "1" ) {
      $htmlHelper->PrintIcon( $row, $params, false, '' );
    }
    //<!-- Druckfunktion Ende -->
  } 
?>
<!-- Header END -->

<!-- section header e.g. ranking, results etc. -->
<table width="100%" class="contentpaneopen">
	<tr>
		<td class="contentheading">
		<?php
      if ($results_config['show_section_heading']==1)
      $htmlHelper->show_matchdays_title(_JL_RESULTS, $rounds[$current_round-1]->id, $results_config);
      if (defined('JL_SHOW_EDIT_ICON')) $htmlHelper->show_edit_icon($current_round, $jl_func);
		?>
		</td><?php
// select navigation of matchdays for browsing mode START
if (isset($pageNav2)&&$results_config['show_matchday_dropdown']==1) echo '<td align="right">'._JL_MATCHDAYS_SELECT.$pageNav2.'</td>';
// select navigation of matchdays for browsing mode ENDS    
?>		
    </tr>
</table>
<br />
<!-- section header ends -->

<!-- Main START -->
<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
<?php
if (isset($overall_config['results_below'])&&$overall_config['results_below']==1) $results_config['results_below']=1;
$htmlHelper->resultsColspan($results_config);
if (count($matches) > 0) {
  $htmlHelper->show_matches($matches, $results_config);
}
?>
</table>
<?php
if (isset($pageNav)&&$results_config['show_matchday_pagenav']==1) { ?>
<!-- Matchdays Output  -->
<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
  <tr>
   <td align="center"><br /><?php echo $pageNav ?></td>
  </tr>
</table>
<br />
<!-- Matchdays Output END -->
<?php } ?>
<!-- section header e.g. ranking, results etc. -->

<?php if ($table_config['show_section_heading']==1) { ;?>
<table class="contentpaneopen" width="100%">
 	<tr>
   <td class="contentheading">
<?php printf(_JL_TABLE_ALL);
$htmlHelper->show_matchdays_title(_JL_TABLE, $rounds[$current_round-1]->id, $table_config);?>
</td>
	</tr>
</table>
<?php } ;?>
<!-- section header ends -->

<br />

<!-- ranking START -->
<?php

foreach ( $current_ranking as $key=>$cu_rk ) {
  if ($key) {
    echo '<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0"><tr><td class="contentheading">';
      $htmlHelper->show_ranking_division_title($key);
    echo '</td></tr></table>';
  }
  ?>
  <table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
  <?php
  $htmlHelper->show_ranking_heading($type,$table_config);
  $htmlHelper->show_ranking_entries($cu_rk, $previous_ranking[$key], array(), array(), $type,$table_config);
  ?>
  </table><br/>
  <?php
}
?>

<!-- ranking END -->
<!-- colors legend START -->
<?php if ($table_config['show_colors_legend']==1){;?>
<br />
<table width="96%" align="center" cellpadding="3" cellspacing="0">
  <tr>
      <?php
       $htmlHelper->show_colors_legend($colors);
      ?>
  </tr>
</table>
<?php };?>
<!-- colors legend END -->
<!-- if available points manipulations with explanations START -->
<?php
$htmlHelper->show_manipulations ($result);
 ?>
<!-- if available points manipulations with explanations END -->

<!-- matchdays pageNav -->
<?php
if (isset($pageNav)&&$table_config['show_matchday_pagenav']==1) { ?>
<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
  <tr>
   <td align="center">
   <br />
   <?php echo $pageNav ?>
<br /></td>
  </tr>
</table>
<?php
} ?>
<!-- Amatchdays pageNav END -->

<!-- Print Button START -->
<?php if ($results_config['show_back_button'] > 0 OR $overall_config['show_back_button'] > 0 OR $table_config['show_back_button'] > 0) {;?>
<?php if ($results_config['show_back_button'] == "1" OR $overall_config['show_back_button'] == "1" OR $table_config['show_back_button'] == "1") echo '<div align="left">'; else echo '<div align="right">';?>
<?php
$params = & new mosParameters( '' );
$params->def( 'back_button', true );
$params->def( 'popup', false );
mosHTML::BackButton( $params );
  echo "</div>";
};?>
<!-- Print Button END -->
</div>